package com.code9xs.util;

import com.code9xs.mapper.ToDoMapper;
import com.code9xs.pojo.ToDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author Suhd
 * @date 2021/5/24
 * @time 20:10
 * @wechat i9xswanan
 * @github https://github.com/Code9xs
 */
@Component
public class CommonUtils {
    @Autowired
    private  ToDoMapper toDoMapper;
    public  boolean addToDo(Integer uid,Integer eventId,String status,String type){
        final ToDo toDo = new ToDo();
        toDo.setUid(uid);
        toDo.setEventId(eventId);
        toDo.setType(type);
        toDo.setStatus(status);
        final int flag = toDoMapper.insertSelective(toDo);
        if (flag > 0){
            return true;
        }
        return false;
    }
}
